﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SysAdmin.aspx.cs" Inherits="Manager_SysAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统管理员</title>
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="Mask" AutoSizePanelID="gridList" />
        <ext:Grid ID="gridList" runat="server" Title="管理用户表" AllowPaging="true" PageSize="30"
            EmptyText="暂时没有相关数据!" ShowBorder="true" EnableCheckBoxSelect="false" EnableRowNumber="true"
            DataKeyNames="mId,mUser" AllowCellEditing="true" ClicksToEdit="1" ForceFitAllTime="true"
            OnRowCommand="gridList_RowCommand">
            <Toolbars>
                <ext:Toolbar ID="tlGridList" runat="server">
                    <Items>
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                        </ext:ToolbarFill>
                        <ext:Button ID="btnAddAdmin" runat="server" Text="新增管理员" Icon="add" OnClick="btnAddAdmin_Click">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <Columns>
                <ext:BoundField ID="bfUserName" runat="server" DataField="mUser" HeaderText="用户名" />
                <ext:RenderField ID="rfPwd" runat="server" HeaderText="登录密码" FieldType="string">
                    <Editor>
                        <ext:TextBox ID="txtPwd" runat="server" Text='<%# Eval("mPwd") %>' TextMode="password">
                        </ext:TextBox>
                    </Editor>
                </ext:RenderField>
                <ext:TemplateField ID="TemplateField1" runat="server" HeaderText="最后登录IP">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# WebBase.GetClientIP.getNum2IPAddress(Convert.ToInt64(Eval("mLastIP")))  %>'></asp:Label>
                    </ItemTemplate>
                </ext:TemplateField>
                <ext:BoundField ID="bfLastTime" runat="server" DataField="mLastDate" HeaderText="最后登录时间"
                    Width="200" />
                <ext:RenderCheckField ID="bcfStatus" runat="server" DataField="mStatus" HeaderText="状态"
                    Width="40" TextAlign="center" />
                <ext:LinkButtonField ID="lbfSave" runat="server" Icon="ApplicationFormEdit" ConfirmText="确定修改？"
                    CommandName="Modify" TextAlign="center" Width="40" />
                <ext:LinkButtonField ID="lbfDelete" runat="server" Icon="delete" ConfirmText="确定删除？"
                    CommandName="Delete" TextAlign="center" Width="40" />
            </Columns>
            <PageItems>
                <ext:Button ID="btnRefresh" runat="server" Icon="arrowrefresh" OnClick="btnRefresh_Click"></ext:Button>
                <ext:ToolbarFill ID="ToolbarFill3" runat="server"></ext:ToolbarFill>
                <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                </ext:ToolbarSeparator>
                <ext:ToolbarText ID="ToolbarText2" runat="server" Text="每页记录数：">
                </ext:ToolbarText>
                <ext:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
                    OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                    <ext:ListItem Text="15" Value="15" />
                    <ext:ListItem Text="20" Value="20" />
                    <ext:ListItem Text="25" Value="25" Selected="true" />
                </ext:DropDownList>
            </PageItems>
        </ext:Grid>
        <ext:Window ID="winAdmin" runat="server" Popup="false" Width="360" Title="新增管理用户" CloseAction="HideRefresh">
            <Items>
                <ext:SimpleForm ID="sfAdmin" runat="server" BodyPadding="10px" AutoHeight="true"
                    ShowHeader="false" LabelAlign="right" FooterBarAlign="center">
                    <Items>
                        <ext:TextBox ID="txtUserName" runat="server" Label="登录帐户" Required="true">
                        </ext:TextBox>
                        <ext:TextBox ID="txtUserPwd" runat="server" Label="登录密码" Required="true" TextMode="password">
                        </ext:TextBox>
                        <ext:TextBox ID="txtReUserPwd" runat="server" Label="确认密码" Required="true" TextMode="password"
                            CompareControl="txtUserPwd">
                        </ext:TextBox>
                        <ext:CheckBox ID="cboxStatus" runat="server" Label="状态" Text="启用/锁定">
                        </ext:CheckBox>
                    </Items>
                    <Toolbars>
                        <ext:Toolbar ID="tbButton" runat="server" Position="footer">
                            <Items>
                                <ext:ToolbarFill ID="ToolbarFill2" runat="server">
                                </ext:ToolbarFill>
                                <ext:Button ID="btnSubmit" runat="server" Text="保存" Icon="systemsave" ValidateForms="sfAdmin"
                                    ValidateTarget="self" OnClick="btnSubmit_Click">
                                </ext:Button>
                                <ext:Button ID="btnReset" runat="server" Text="重置" Icon="reload">
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </Toolbars>
                </ext:SimpleForm>
            </Items>
        </ext:Window>
    </form>
</body>
</html>
